package com.mimiwang.animal.service.Imp;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mimiwang.animal.entity.AnimalType;
import com.mimiwang.animal.mapper.AnimalTypeMapper;
import com.mimiwang.animal.service.IAnimalTypeService;
import com.mimiwang.common.vo.school.PageConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @AUTHOR:游李滨
 * @DATE:2023/4/19 16:02
 */
@Service
public class AnimalTypeServiceImpl implements IAnimalTypeService {

    @Autowired
    AnimalTypeMapper animalTypeMapper;


    @Override
    public PageInfo<AnimalType> selectAllAnimalType(PageConfig pageConfig) {
        PageHelper.startPage(pageConfig);
        List<AnimalType> animalTypes = animalTypeMapper.selectAllAnimalType();
        return new PageInfo<>(animalTypes);
    }

    @Override
    public AnimalType selectAnimalTypeById(long id) {


        return animalTypeMapper.selectAnimalTypeById(id);
    }
}
